<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Ajax post请求</title>
	</head>
	<body>
		<h1>Axios远程调用练习</h1>
		
		<script src="../js/axios.js"></script>
		<script>
				/* 1.post请求说明 form表单提交/新增入库时 */
				
				/* 1. 需求: 实现用户信息新增 id/name/age/sex */
				let user = {
					name: "长命百岁",
					age:	100,
					sex: "未知"
				}
				//post请求的参数 直接传递.
				axios.post("http://localhost:8090/saveUser",user)
				.then(result => {
					console.log(result.data)
				})
				
				
				/**
				 * 利用restFul风格实现用户新增 清华北大
				 */
				axios.post("http://localhost:8090/user/好生活/100/其他")
					 .then(result => {
						 console.log(result.data)
				})
				
				
				
				
				
				
				
				
		</script>
	</body>
</html>